package cn.nnxy.zentao.service.impl;

import cn.nnxy.zentao.domain.ZTest;
import cn.nnxy.zentao.mapper.ZTestMapper;
import cn.nnxy.zentao.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TestServiceImpl implements TestService {
    @Autowired
    private ZTestMapper testMapper;
    @Override
    public List<ZTest> queryList() {
        return testMapper.selectList();
    }

    @Override
    public ZTest seletById(Integer id) {
        if (null == id){
            return null;
        }
        return seletById(id);
    }

    @Override
    public int saveTest(ZTest test) {
        if (null == test){
            return 0;
        }
        return testMapper.insert(test);
    }

    @Override
    public int updateById(ZTest test) {
        if (null == test || test.getTestId() == null){
            return 0;
        }
        return testMapper.updateById(test);
    }

    @Override
    public int deleteById(Integer id) {
        if (null == id){
            return 0;
        }
        return testMapper.deleteById(id);
    }
}
